package tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import desa.Posicion;
import desa.Vector;

public class PosicionTest {
	Posicion a;
	Posicion b;

	@Before
	public void setUp() throws Exception {
		a = new Posicion(3,-5);
		b = new Posicion(2, 4);
	}
	
	@Test
	public void testGetX() {
		assertTrue(a.getX() == 3);
	}
	
	@Test
	public void testGetY() {
		assertTrue(a.getY() == -5);
	}
	
	@Test
	public void testSumarPosiciones() {		
		Vector c;
		c = a.sumar(b);
		assertTrue(c.getX() == 5);
		assertTrue(c.getY() == -1);
	}
}
